package com.ly.web.controller.erp;

import com.ly.common.PageParam;
import com.ly.common.annotation.Log;
import com.ly.common.core.domain.AjaxResult;
import com.ly.heart.domain.KingDiffLogEntity;
import com.ly.heart.service.IKingDiffLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 金蝶-差异日志 前端控制器
 * </p>
 *
 * @author WuZH
 * @since 2024-07-30
 */
@Api ( value = "KingDiffLog", tags = "金蝶-差异日志" )
@RestController
@RequestMapping ( "/heart/KingDiffLog" )
public class KingDiffLogController {

    @Resource
    private IKingDiffLogService iKingDiffLogService;

    @GetMapping ( "list" )
    @Log ( title = "查询差异日志列表" )
    @ApiOperation ( "查询差异日志列表" )
    public AjaxResult queryList ( KingDiffLogEntity kingDiffLogEntity ) {
        List<KingDiffLogEntity> kingDiffLogEntities = iKingDiffLogService.queryList ( kingDiffLogEntity );
        PageParam pageParam = new PageParam ();
        pageParam.setCurrent ( kingDiffLogEntity.getPage () );
        pageParam.setRecords ( kingDiffLogEntities );
        pageParam.setSize ( kingDiffLogEntity.getLimit () );
        pageParam.setTotal ( iKingDiffLogService.queryCount ( kingDiffLogEntity ) );
        return AjaxResult.success ( pageParam );
    }

}
